function ttf_on_doc_ready(){

	tt_timeline=new ttc_timeline({
	  parent:false,
	  domID:'tt_timeline'
	});

	if(!tt_timeline.set({
	    frameCnt:5,
	    layerCnt:2,
			visibility:[1,0]
		})){
		  alert(tt_timeline.errors());
	}
}

function tt_event(nm,prm){
	console.log('event',nm,prm);
	switch(nm){
	  case 'tlGetCanvas':{
      tt_timeline.select(prm.fid, prm.lid);
	    break;
		}
		case 'tlChange':{
		  switch(prm.act){
		    case 'visibility':{
		      tt_timeline.visibility(prm.lid, prm.visibility);
		      break;
				}
			}
		  break;
		}
		case 'tlPlayTrigger':{
			if(tt_timeline.state.play) tt_timeline.stop();
			else tt_timeline.play();
			break;
		}
	}
}